-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8343789: Move mutable nmethod data out of CodeCache #21276
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back bulasevich! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@bulasevich The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
@vnkozlov Hi Vladimir, |
b15f504
to
531b630
Compare
9444108
to
c90f5b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, thank you for doing his work.
Main question is: why you did it only for nmethod
?
Second question: do you see any performance effects with this change?
My concern is that we iterate relocation info data from different memory space to patch code.
ldr_constant(dst, Address(dummy, rspec)); | ||
mov(dst, Address(dummy, rspec)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- it is not a load from a Constant Pool, so calling ldr_constant here is seems incorrect
- the ldr_constant function utilizes either ldr (with a range limit of ±1MB) or, when -XX:-NearCpool is enabled, adrp (range limit of ±2GB) followed by ldr — both of which may fall short when mutable data is allocated on the C heap.
src/hotspot/share/code/codeBlob.cpp
Outdated
return size; | ||
} | ||
|
||
CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size, | ||
int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) : | ||
int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments, | ||
bool external_mutable_data) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to add assert(!external_mutable_data || (kind == CodeBlobKind::Nmethod)
address _mutable_data; | ||
int _mutable_data_size; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add special CodeBlob subclass for nmethod to avoid increase of size for all blobs and stubs?
nonstatic_field(nmethod, _mutable_data, address) \ | ||
nonstatic_field(nmethod, _mutable_data_size, int) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are filed in CodeBlob and not in nmethod.
Note, with https://bugs.openjdk.org/browse/JDK-8334691 and other changes I moving into direction to make relocation info data immutable. It is already "immutable" in mainline JDK after https://bugs.openjdk.org/browse/JDK-8333819. But it is still mutable in Leyden because we have to patch indexes during publishing nmethod. My idea was to move relocation info data (which has big size) into |
Mutable sizes % do not add up:
|
Yes. I did it symmetrically to a separate immutable data storage for nmethod. Now I see I do not like implementation where for some blobs relocation info is local, but for other it stays aside. I am going to rework that.
On the aarch machine I see a slight improvement on the big benchmark caused by the code sparsity improvement. Though I need to do more benchmarking to make sure I am not making things worse for others.
|
Thanks. The correct sizes:
|
Hmm. If relocation info goes to an immutable blob, oops+metadata hardly deserves a separate blob. |
c90f5b7
to
52dd527
Compare
Performance update. On an aarch machine the CodeCacheStress benchmark shows a 1-2% performance improvement with this change, Statistics on the CodeCacheStress benchmark with high numberOfClasses-instanceCount-rangeOfClasses parameter values:
|
31dffae
to
d97dc92
Compare
d97dc92
to
c401e77
Compare
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21276/head:pull/21276
$ git checkout pull/21276
Update a local copy of the PR:
$ git checkout pull/21276
$ git pull https://git.openjdk.org/jdk.git pull/21276/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21276
View PR using the GUI difftool:
$ git pr show -t 21276
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21276.diff